#!/bin/bash

CPU=32
MEM=64
DISK=/export/openEuler.img
ISO=/export/openEuler-22.03-LTS-x86_64-dvd.iso

args=(
-smp ${CPU}
-m ${MEM}G
-enable-kvm
-drive file=${DISK},if=none,id=disk0,format=qcow2
-device virtio-blk-pci,drive=disk0,scsi=off,bootindex=2
-netdev user,id=net0,hostfwd=tcp:127.0.0.1:5567-:22
-device virtio-net-pci,netdev=net0
-vnc :0
-drive id=cdrom0,if=none,format=raw,readonly=on,file=${ISO}
-device virtio-scsi-pci,id=scsi0,bus=pci.0
-device scsi-cd,bus=scsi0.0,drive=cdrom0,bootindex=1
-boot menu=on
)

args_run=(
-smp ${CPU}
-m ${MEM}G
-enable-kvm
-drive file=${DISK},if=none,id=disk0,format=qcow2
-device virtio-blk-pci,drive=disk0,scsi=off,bootindex=1
-netdev user,id=net0,hostfwd=tcp:127.0.0.1:5567-:22
-device virtio-net-pci,netdev=net0
-vga vmware
-vnc :1
)


#qemu-system-x86_64 ${args_run[@]} $@
qemu-system-x86_64 ${args[@]} $@

